/*
 * Ext JS Library 2.2.1
 * Copyright(c) 2006-2009, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://extjs.com/license
 */


Ext.onReady(function(){

    Ext.QuickTips.init();
    
    var msg = function(title, msg){
        Ext.Msg.show({
            title: title, 
            msg: msg,
            minWidth: 200,
            modal: true,
            icon: Ext.Msg.INFO,
            buttons: Ext.Msg.OK
        });
    };
    
    var fibasic = new Ext.form.FileUploadField({
        //renderTo: 'fi-basic',
    	id:'imageFile',
        width: 400
    });

    var boton1=new Ext.Button({
        text: 'Cargar..',
      //  renderTo: 'fi-basic-btn',
        handler: function(){
             // alert(document.formUploadCreditos) ;
              document.formUploadCreditos.submit();
        	/*
	               Ext.getCmp('formUploadCreditos').submit({
	                  
	                    waitMsg: 'Cargando el archivo...',
	                    success: function(fp, o){
	                        msg('Success', 'Processed file "'+o.result.file+'" on the server');
	                    }
	                });
                */
            }
    });
    
    var fbutton = new Ext.form.FileUploadField({
       // renderTo: 'fi-button',
        buttonOnly: true,
        listeners: {
            'fileselected': function(fb, v){
                var el = Ext.fly('fi-button-msg');
                el.update('<b>Selected:</b> '+v);
                if(!el.isVisible()){
                    el.slideIn('t', {
                        duration: .2,
                        easing: 'easeIn',
                        callback: function(){
                            el.highlight();
                        }
                    });
                }else{
                    el.highlight();
                }
            }
        }
    });
    

       var fsf = new Ext.Panel({
        	renderTo: 'fi-form',
        	title: 'Carga de Creditos',
        	width:500,
        	defaults: {bodyStyle : 'padding:0px 0px 0;', border : false},
     		items: [
     		{
					
					id : 'datosGenerales',
				    border:true,
				    //autoHeight:true,
					layout:'table',
					width:500,
					layoutConfig:{columns: 2},
					defaults:{bodyStyle:'padding:2px 0px 0;', border:false},
					items:[{ //
							layout: 'table',
							//colspan:5,
							boder:false,
						   	defaults : {bodyStyle : 'padding:0px 0px 0;', border : false},
					    	layoutConfig: {columns: 1},
					    	items:[ fibasic, boton1]
						} ]
     		}
     				]
		});
		

    
});